//
//  Status.swift
//  Three-SinaWeibo
//
//  Created by 李旭阳 on 15/11/17.
//  Copyright © 2015年 apple. All rights reserved.
//

import UIKit

class Status: NSObject {
    
    //微博创建时间
    var created_at: String?
    //微博ID
    var id: Int = 0
    
    //微博信息内容
    var text: String?
    
    //微博来源
    var source: String?
    
    //定义user 属性
    var user: User?
    
    //KVC设置初始值
    init(dict: [String: AnyObject]) {
        super.init()
        self.setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user" {
            if let dict = value as? [String: AnyObject]{
                user = User(dict: dict)
            }
        }
        return
    }
    
    //MARK: 过滤没有用到的字段
    override func setValue(value: AnyObject?, forUndefinedKey key: String){}

}